Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a test city (streets and river centerline) to use for testing rcoins #27

Merged
merged 15 commits into from
Dec 16, 2024

Conversation

vanlankveldthijs
Copy link
Collaborator

This includes

  • a script to create the Bucharest dataset with street network and rive center line.
  • the data when created.
  • minimal tests to check the data is not empty.

This also required osmdata to be added to the environment.

@vanlankveldthijs
Copy link
Collaborator Author

Note that most of the functions are almost directly copy-pasted from the CRiSp package. We may consider factorizing these into their own package (at some point) if they're reused in a number of other packages.

@vanlankveldthijs
Copy link
Collaborator Author

Also note that this dataset stores the city name with the data. The other parts of the data are stored in the geom member.

Copy link
Contributor

@fnattino fnattino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @vanlankveldthijs, looks good ! Just left few comments, I know they make the code less generic, but for the data script I would actually prefer to have a short and straightforward script..

tests/testthat/test-data.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
@fnattino fnattino mentioned this pull request Nov 21, 2024
@fnattino
Copy link
Contributor

@vanlankveldthijs After discussing it with @cforgaci, we think it makes more sense to call the test data bucharest instead of test_city. So no need for bucharest$name, spatial objects can be included at top level (like bucharest$streets and bucharest$river_centerline). This is for consistency with other R (spatial?) packages like sf and sfnetworks, where test data seems to be included directly using the name of the geographic area.

Copy link
Contributor

@cforgaci cforgaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanlankveldthijs thanks. I left a few additional comments.
@fnattino fyi

R/data.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
Copy link
Contributor

@cforgaci cforgaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few more suggestions related to renaming the package to bucharest

data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
data-raw/test_city.R Outdated Show resolved Hide resolved
vanlankveldthijs and others added 2 commits December 9, 2024 16:23
Applied various review suggestions for changes.

Co-authored-by: Claudiu Forgaci <[email protected]>
Co-authored-by: Francesco Nattino <[email protected]>
@vanlankveldthijs
Copy link
Collaborator Author

All previous reviews and code suggestions should now be resolved.

Copy link
Contributor

@cforgaci cforgaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vanlankveldthijs. I added a few more tiny suggestions. These are needed for the lintr, test and (part of) R-CMD-check actions to pass.

tests/testthat/test-data.R Outdated Show resolved Hide resolved
tests/testthat/test-data.R Outdated Show resolved Hide resolved
tests/testthat/test-data.R Outdated Show resolved Hide resolved
data-raw/bucharest.R Show resolved Hide resolved
data-raw/bucharest.R Show resolved Hide resolved
data-raw/bucharest.R Show resolved Hide resolved
data-raw/bucharest.R Show resolved Hide resolved
data/test_city.rda Outdated Show resolved Hide resolved
DESCRIPTION Show resolved Hide resolved
Copy link
Contributor

@cforgaci cforgaci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vanlankveldthijs, many thanks! All checks passing now. @fnattino, if you also agree, this can be merged.

Copy link
Contributor

@fnattino fnattino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @vanlankveldthijs and @cforgaci - a very minor suggestion from my side, then good to merge for me!

environment.yml Outdated
@@ -14,3 +14,4 @@ dependencies:
- r-testthat >=3.0.0
# Others
- r-lintr
- r-osmdata
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe put r-osmdata right after r-sfnetworks in the list, as it is part of the "Suggests" section?

Copy link
Contributor

@fnattino fnattino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for taking over @vanlankveldthijs , since it was a very minor thing I thought I would fix it quickly. Really thank you so much!

@fnattino fnattino merged commit fcfa3d4 into main Dec 16, 2024
4 checks passed
@fnattino fnattino deleted the add_real_test_dataset branch December 16, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants